package com.yunfei.bo.msgRuleConfig;
import com.yunfei.entity.msgRuleConfig.*;
import com.yunfei.utils.string.StringUtil;
/**
*@tablename MSG_RULE_CONFIG
*@author zhengyunfei
*@createDate Thu Feb 21 13:52:04 CST 2019
*/ 
public class MsgRuleConfigBo implements java.io.Serializable{
	private String msgCfgId;
	private String msgRuleName;
	private String sendTimeType;
	private String advanceDays;
	private String remainAmt;
	private String sendDate;
	private String msgContext;
	private String msgObject;
	private String msgPicAddr;
	private String effeFlg;
	private String userId;
	private String createDate;
	private String operId;
	private String operDate;
	private String field;
	private String order;
   /**
		* 更改排序字段
		* @return
		*/
   public String getField() {
		   return field;
   }
   public void setField(String field) {
		   this.field = field;
   }
   public String getOrder() {
		   return order;
   }
   public void setOrder(String order) {
		   this.order = order;
   }
	private int curNo;
	public int getCurNo() {
		int value=(curNo-1)*curSize;
		return value;
	}	
	public void setCurNo(int curNo) {
		this.curNo = curNo;
	}
	private int curSize;
	public int getCurSize() {
		return curSize;
	}
	public void setCurSize(int curSize) {
		this.curSize = curSize;
	}
	public void setMsgCfgId(String msgCfgId){
		this.msgCfgId=msgCfgId;
	}
	public String getMsgCfgId(){
		return msgCfgId;
	}
	public void setMsgRuleName(String msgRuleName){
		this.msgRuleName=msgRuleName;
	}
	public String getMsgRuleName(){
		return msgRuleName;
	}
	public void setSendTimeType(String sendTimeType){
		this.sendTimeType=sendTimeType;
	}
	public String getSendTimeType(){
	if(!StringUtil.isNullOrEmpty(sendTimeType)){
			sendTimeType=sendTimeType.replace(".0","");
		}
		return sendTimeType;
	}
	public void setAdvanceDays(String advanceDays){
		this.advanceDays=advanceDays;
	}
	public String getAdvanceDays(){
		return advanceDays;
	}
	public void setRemainAmt(String remainAmt){
		this.remainAmt=remainAmt;
	}
	public String getRemainAmt(){
		return remainAmt;
	}
	public void setSendDate(String sendDate){
		this.sendDate=sendDate;
	}
	public String getSendDate(){
		return sendDate;
	}
	public void setMsgContext(String msgContext){
		this.msgContext=msgContext;
	}
	public String getMsgContext(){
		return msgContext;
	}
	public void setMsgObject(String msgObject){
		this.msgObject=msgObject;
	}
	public String getMsgObject(){
		return msgObject;
	}
	public void setMsgPicAddr(String msgPicAddr){
		this.msgPicAddr=msgPicAddr;
	}
	public String getMsgPicAddr(){
		return msgPicAddr;
	}
	public void setEffeFlg(String effeFlg){
		this.effeFlg=effeFlg;
	}
	public String getEffeFlg(){
		return effeFlg;
	}
	public void setUserId(String userId){
		this.userId=userId;
	}
	public String getUserId(){
		return userId;
	}
	public void setCreateDate(String createDate){
		this.createDate=createDate;
	}
	public String getCreateDate(){
		return createDate;
	}
	public void setOperId(String operId){
		this.operId=operId;
	}
	public String getOperId(){
		return operId;
	}
	public void setOperDate(String operDate){
		this.operDate=operDate;
	}
	public String getOperDate(){
		return operDate;
	}
	public static MsgRuleConfigEntity boToEntity(MsgRuleConfigBo bo){
		MsgRuleConfigEntity entity=new MsgRuleConfigEntity();
		entity.setMsgCfgId(bo.getMsgCfgId());
		entity.setMsgRuleName(bo.getMsgRuleName());
		entity.setSendTimeType(bo.getSendTimeType());
		entity.setAdvanceDays(bo.getAdvanceDays());
		entity.setRemainAmt(bo.getRemainAmt());
		entity.setSendDate(bo.getSendDate());
		entity.setMsgContext(bo.getMsgContext());
		entity.setMsgObject(bo.getMsgObject());
		entity.setMsgPicAddr(bo.getMsgPicAddr());
		entity.setEffeFlg(bo.getEffeFlg());
		entity.setUserId(bo.getUserId());
		entity.setCreateDate(bo.getCreateDate());
		entity.setOperId(bo.getOperId());
		entity.setOperDate(bo.getOperDate());
		return entity;
	}
	public static MsgRuleConfigBo entityToBo(MsgRuleConfigEntity bo){
		MsgRuleConfigBo entity=new MsgRuleConfigBo();
		entity.setMsgCfgId(bo.getMsgCfgId());
		entity.setMsgRuleName(bo.getMsgRuleName());
		entity.setSendTimeType(bo.getSendTimeType());
		entity.setAdvanceDays(bo.getAdvanceDays());
		entity.setRemainAmt(bo.getRemainAmt());
		entity.setSendDate(bo.getSendDate());
		entity.setMsgContext(bo.getMsgContext());
		entity.setMsgObject(bo.getMsgObject());
		entity.setMsgPicAddr(bo.getMsgPicAddr());
		entity.setEffeFlg(bo.getEffeFlg());
		entity.setUserId(bo.getUserId());
		entity.setCreateDate(bo.getCreateDate());
		entity.setOperId(bo.getOperId());
		entity.setOperDate(bo.getOperDate());
		return entity;
	}
	public static String changeFieldColumn(String field){
		String result="";
			if(!StringUtil.isNullOrEmpty(field)){
				if(field.equals("msgCfgId")){
					result="MSG_CFG_ID";
				}
				if(field.equals("msgRuleName")){
					result="MSG_RULE_NAME";
				}
				if(field.equals("sendTimeType")){
					result="SEND_TIME_TYPE";
				}
				if(field.equals("advanceDays")){
					result="ADVANCE_DAYS";
				}
				if(field.equals("remainAmt")){
					result="REMAIN_AMT";
				}
				if(field.equals("sendDate")){
					result="SEND_DATE";
				}
				if(field.equals("msgContext")){
					result="MSG_CONTEXT";
				}
				if(field.equals("msgObject")){
					result="MSG_OBJECT";
				}
				if(field.equals("msgPicAddr")){
					result="MSG_PIC_ADDR";
				}
				if(field.equals("effeFlg")){
					result="EFFE_FLG";
				}
				if(field.equals("userId")){
					result="USER_ID";
				}
				if(field.equals("createDate")){
					result="CREATE_DATE";
				}
				if(field.equals("operId")){
					result="OPER_ID";
				}
				if(field.equals("operDate")){
					result="OPER_DATE";
				}
		}
		return result;
	}
}

